```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Git版本控制系统详解 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #2d3748;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .code-block {
            background-color: #f8fafc;
            border-left: 4px solid #667eea;
        }
        .highlight {
            position: relative;
        }
        .highlight:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 40%;
            background-color: rgba(102, 126, 234, 0.1);
            z-index: -1;
        }
        .mermaid {
            background-color: #f8fafc;
            border-radius: 0.5rem;
            padding: 1.5rem;
        }
        .tooltip {
            position: relative;
            display: inline-block;
            border-bottom: 1px dotted #667eea;
        }
        .tooltip .tooltiptext {
            visibility: hidden;
            width: 200px;
            background-color: #2d3748;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 5px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            margin-left: -100px;
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 0.875rem;
        }
        .tooltip:hover .tooltiptext {
            visibility: visible;
            opacity: 1;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="flex flex-col items-center text-center">
                <span class="inline-block px-3 py-1 text-xs font-semibold bg-white text-indigo-700 rounded-full mb-4">版本控制专家指南</span>
                <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">掌握Git版本控制系统</h1>
                <p class="text-xl md:text-2xl opacity-90 mb-8 max-w-3xl">在团队协作中实现高效代码管理的最佳实践与技巧</p>
                <div class="flex space-x-4">
                    <a href="#getting-started" class="bg-white text-indigo-700 font-medium px-6 py-3 rounded-lg hover:bg-gray-100 transition duration-300">开始学习</a>
                    <a href="#vcs-types" class="border-2 border-white text-white font-medium px-6 py-3 rounded-lg hover:bg-white hover:bg-opacity-10 transition duration-300">版本控制类型</a>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12 max-w-5xl">
        <!-- Intro Section -->
        <section class="mb-16" id="getting-started">
            <div class="bg-white rounded-2xl shadow-lg p-8 md:p-10 mb-8">
                <h2 class="text-3xl font-bold mb-6 text-center">现代软件开发中的版本控制</h2>
                <p class="text-lg mb-6 text-gray-700 leading-relaxed">
                    在现代软件开发过程中，版本控制系统（VCS）已成为不可或缺的工具。它不仅帮助开发者追踪和管理代码的历史变更，还能在团队协作中提供更高效的工作方式。Git作为最流行的版本控制系统之一，通过其强大的功能，成为全球开发者的首选工具。
                </p>
                <div class="flex flex-wrap justify-center gap-6 mt-8">
                    <div class="flex items-center">
                        <div class="bg-indigo-100 p-3 rounded-full mr-3">
                            <i class="fas fa-history text-indigo-700 text-xl"></i>
                        </div>
                        <span class="font-medium">变更历史追踪</span>
                    </div>
                    <div class="flex items-center">
                        <div class="bg-indigo-100 p-3 rounded-full mr-3">
                            <i class="fas fa-users text-indigo-700 text-xl"></i>
                        </div>
                        <span class="font-medium">团队协作支持</span>
                    </div>
                    <div class="flex items-center">
                        <div class="bg-indigo-100 p-3 rounded-full mr-3">
                            <i class="fas fa-code-branch text-indigo-700 text-xl"></i>
                        </div>
                        <span class="font-medium">分支管理</span>
                    </div>
                    <div class="flex items-center">
                        <div class="bg-indigo-100 p-3 rounded-full mr-3">
                            <i class="fas fa-undo text-indigo-700 text-xl"></i>
                        </div>
                        <span class="font-medium">代码恢复</span>
                    </div>
                </div>
            </div>
        </section>

        <!-- VCS Overview -->
        <section class="mb-16" id="vcs-types">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">1. 版本控制概述</h2>
            <p class="mb-6 text-gray-700">
                版本控制系统（VCS）是一种记录计算机文件内容变化的系统，使得开发者可以追溯文件的历史版本并进行相应的管理。通过使用VCS，开发者可以轻松查看、恢复、合并和管理不同版本的代码，同时避免因为多人协作而产生的代码冲突。
            </p>

            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-laptop-code text-blue-700 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">1.1 版本控制的类型</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">本地版本控制系统</h4>
                            <p class="text-gray-700">最简单的版本控制形式，将文件历史记录保存在本地机器上（如RCS），适合个人使用但缺乏协作能力。</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">集中式版本控制系统</h4>
                            <p class="text-gray-700">使用中央服务器存储代码版本（如SVN），简化了管理但对网络依赖性强，服务器故障影响所有开发者。</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">分布式版本控制系统</h4>
                            <p class="text-gray-700">每个开发者拥有完整代码副本（如Git），支持离线工作，适合大规模协作，是现代开发的首选方案。</p>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-full mr-4">
                            <i class="fas fa-check-circle text-green-700 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">1.2 版本控制的好处</h3>
                    </div>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-3"></i>
                            <span class="text-gray-700"><strong>版本管理：</strong>所有修改都被记录，可随时回溯历史版本</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-3"></i>
                            <span class="text-gray-700"><strong>团队协作：</strong>支持多人并行开发，处理并发修改</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-3"></i>
                            <span class="text-gray-700"><strong>代码备份：</strong>轻松恢复之前的版本，防止数据丢失</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-3"></i>
                            <span class="text-gray-700"><strong>变更跟踪：</strong>清晰记录每次修改，理解变更原因</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-3"></i>
                            <span class="text-gray-700"><strong>实验性开发：</strong>通过分支进行功能实验不影响主代码</span>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="mermaid mb-8">
                graph TD
                    A[版本控制系统] --> B[本地VCS]
                    A --> C[集中式VCS]
                    A --> D[分布式VCS]
                    B --> B1[RCS]
                    C --> C1[CVS]
                    C --> C2[Subversion]
                    D --> D1[Git]
                    D --> D2[Mercurial]
            </div>
        </section>

        <!-- Git Basics -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">2. Git基础知识</h2>
            <p class="mb-6 text-gray-700">
                Git是一款分布式版本控制系统，它通过管理代码的快照（commit）来帮助开发者管理代码历史。理解Git的基本操作是每位开发者的必备技能。
            </p>

            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-purple-100 p-3 rounded-full mr-4">
                                <i class="fas fa-terminal text-purple-700 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-bold">2.1 Git常用命令</h3>
                        </div>
                        <div class="space-y-4">
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-1">初始化与克隆</h4>
                                <div class="code-block p-4 rounded-lg mb-3">
                                    <code class="text-sm">git init</code><br>
                                    <code class="text-sm">git clone &lt;repo-url&gt;</code>
                                </div>
                            </div>
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-1">提交更改</h4>
                                <div class="code-block p-4 rounded-lg mb-3">
                                    <code class="text-sm">git add &lt;file&gt;</code><br>
                                    <code class="text-sm">git commit -m "提交信息"</code>
                                </div>
                            </div>
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-1">同步远程</h4>
                                <div class="code-block p-4 rounded-lg mb-3">
                                    <code class="text-sm">git push</code><br>
                                    <code class="text-sm">git pull</code>
                                </div>
                            </div>
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-1">分支操作</h4>
                                <div class="code-block p-4 rounded-lg">
                                    <code class="text-sm">git branch &lt;branch-name&gt;</code><br>
                                    <code class="text-sm">git checkout &lt;branch-name&gt;</code><br>
                                    <code class="text-sm">git merge &lt;branch-name&gt;</code>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-orange-100 p-3 rounded-full mr-4">
                                <i class="fas fa-layer-group text-orange-700 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-bold">2.2 Git的工作区、暂存区和仓库</h3>
                        </div>
                        <div class="mermaid mb-6">
                            graph LR
                                A[工作区] -->|git add| B[暂存区]
                                B -->|git commit| C[本地仓库]
                                C -->|git push| D[远程仓库]
                        </div>
                        <div class="space-y-4">
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-2">工作区 (Working Directory)</h4>
                                <p class="text-gray-700">本地开发目录，直接编辑文件的地方。所有未暂存的修改都存在于工作区。</p>
                            </div>
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-2">暂存区 (Staging Area)</h4>
                                <p class="text-gray-700">通过<code class="bg-gray-100 px-1 py-0.5 rounded">git add</code>将修改添加到暂存区，准备下一次提交的内容。</p>
                            </div>
                            <div>
                                <h4 class="font-semibold text-gray-800 mb-2">本地仓库 (Local Repository)</h4>
                                <p class="text-gray-700">通过<code class="bg-gray-100 px-1 py-0.5 rounded">git commit</code>将暂存区内容提交到本地仓库，形成永久快照。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Git Workflow -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">3. Git工作流概述</h2>
            <p class="mb-6 text-gray-700">
                Git工作流是一种在团队开发中应用的工作方式，旨在通过合理地组织代码分支管理和提交方式，提高开发效率，并确保代码质量。一个清晰的Git工作流能够帮助团队成员高效协作，减少冲突和合并问题。
            </p>

            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">3.1 常见的Git工作流</h3>
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">集中式工作流</h4>
                            <p class="text-gray-700 mb-2">所有开发者直接在主分支上工作，适合小型团队和简单项目。</p>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">简单易用</span>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded ml-2">易冲突</span>
                        </div>
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">功能分支工作流</h4>
                            <p class="text-gray-700 mb-2">每个新功能在独立分支开发，完成后合并回主分支。</p>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">代码隔离</span>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded ml-2">Pull Request</span>
                        </div>
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">GitFlow工作流</h4>
                            <p class="text-gray-700 mb-2">定义长期分支(master/develop)和短期分支(feature/release/hotfix)。</p>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">复杂项目</span>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded ml-2">版本发布</span>
                        </div>
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">GitHub Flow</h4>
                            <p class="text-gray-700 mb-2">简化流程，所有开发在主分支进行，通过Pull Request审查。</p>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">持续交付</span>
                            <span class="inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded ml-2">快速迭代</span>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <div class="mermaid">
                        gitGraph
                            commit
                            branch feature-branch
                            checkout feature-branch
                            commit
                            commit
                            checkout main
                            merge feature-branch
                            branch hotfix-branch
                            checkout hotfix-branch
                            commit
                            checkout main
                            merge hotfix-branch
                    </div>
                    <div class="mt-6">
                        <h3 class="text-xl font-bold mb-4">选择工作流建议</h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 mt-1">
                                    <i class="fas fa-question-circle text-blue-700 text-sm"></i>
                                </div>
                                <span class="text-gray-700">小型团队或简单项目 → <strong>集中式工作流</strong></span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 mt-1">
                                    <i class="fas fa-question-circle text-blue-700 text-sm"></i>
                                </div>
                                <span class="text-gray-700">中型团队或功能开发 → <strong>功能分支工作流</strong></span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 mt-1">
                                    <i class="fas fa-question-circle text-blue-700 text-sm"></i>
                                </div>
                                <span class="text-gray-700">复杂项目或有版本发布 → <strong>GitFlow工作流</strong></span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 mt-1">
                                    <i class="fas fa-question-circle text-blue-700 text-sm"></i>
                                </div>
                                <span class="text-gray-700">持续交付项目 → <strong>GitHub Flow</strong></span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Branch Management -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">4. 版本控制中的分支管理</h2>
            <p class="mb-6 text-gray-700">
                在团队开发中，分支是协作的基础。通过合理的分支策略，团队可以在同一时间并行开发多个功能，同时保持代码的稳定性。
            </p>

            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">4.1 创建和管理分支</h3>
                    <div class="space-y-4">
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">创建分支</h4>
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git branch feature/login</code>
                            </div>
                            <p class="text-gray-700 text-sm">创建一个名为feature/login的新分支</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">切换分支</h4>
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git checkout feature/login</code><br>
                                <code class="text-sm text-gray-600"># 或使用更简洁的方式</code><br>
                                <code>git switch feature/login</code>
                            </div>
                            <p class="text-gray-700 text-sm">切换到feature/login分支进行开发</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">合并分支</h4>
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git checkout main</code><br>
                                <code>git merge feature/login</code>
                            </div>
                            <p class="text-gray-700 text-sm">将feature/login分支合并到main分支</p>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">4.2 保护主分支</h3>
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">主分支保护策略</h4>
                            <p class="text-gray-700">主分支(<code class="bg-gray-100 px-1 py-0.5 rounded">main</code>或<code class="bg-gray-100 px-1 py-0.5 rounded">master</code>)应始终保持可发布状态。最佳实践包括：</p>
                            <ul class="list-disc pl-5 mt-2 space-y-1 text-gray-700">
                                <li>禁止直接推送主分支</li>
                                <li>所有变更通过Pull Request合并</li>
                                <li>要求至少一名团队成员审查代码</li>
                                <li>设置自动化测试和构建检查</li>
                            </ul>
                        </div>
                        <div>
                            <h4 class="font-semibold text-blue-800 mb-2">4.3 多人协作中的分支策略</h4>
                            <div class="grid grid-cols-2 gap-4">
                                <div class="p-3 bg-green-50 rounded-lg">
                                    <h5 class="font-medium text-green-800 mb-1">功能分支</h5>
                                    <p class="text-sm text-gray-700">每个功能独立分支开发，命名如<code class="bg-gray-100 px-1 py-0.5 rounded text-xs">feature/xxx</code></p>
                                </div>
                                <div class="p-3 bg-red-50 rounded-lg">
                                    <h5 class="font-medium text-red-800 mb-1">修复分支</h5>
                                    <p class="text-sm text-gray-700">紧急修复创建<code class="bg-gray-100 px-1 py-0.5 rounded text-xs">hotfix/xxx</code>分支</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Merge & Conflict -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">5. 合并与冲突解决</h2>
            <p class="mb-6 text-gray-700">
                在多人协作时，合并（Merge）和冲突解决是不可避免的。Git提供了多种合并方式，可以帮助开发者解决代码合并中的问题。
            </p>

            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">5.1 合并分支</h3>
                    <div class="space-y-4">
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">基础合并</h4>
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git checkout main</code><br>
                                <code>git merge feature/login</code>
                            </div>
                            <p class="text-gray-700 text-sm">将feature/login分支合并到当前分支(main)</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">合并结果</h4>
                            <ul class="list-disc pl-5 text-gray-700 text-sm space-y-1">
                                <li>无冲突：Git自动创建新的合并提交</li>
                                <li>有冲突：Git暂停合并过程，需要手动解决</li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">5.2 解决合并冲突</h3>
                    <div class="space-y-4">
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">冲突识别</h4>
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git status</code>
                            </div>
                            <p class="text-gray-700 text-sm">查看哪些文件存在冲突</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">冲突解决步骤</h4>
                            <ol class="list-decimal pl-5 text-gray-700 text-sm space-y-1">
                                <li>打开冲突文件，编辑解决冲突</li>
                                <li>删除Git的冲突标记(<code class="bg-gray-100 px-1 py-0.5 rounded">&lt;&lt;&lt;&lt;&lt;&lt;&lt;</code>等)</li>
                                <li>标记为已解决：<code class="bg-gray-100 px-1 py-0.5 rounded">git add &lt;file&gt;</code></li>
                                <li>完成合并：<code class="bg-gray-100 px-1 py-0.5 rounded">git commit</code></li>
                            </ol>
                        </div>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden p-6">
                    <h3 class="text-xl font-bold mb-4">5.3 使用Rebase避免合并提交</h3>
                    <div class="space-y-4">
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <div class="code-block p-4 rounded-lg mb-2">
                                <code>git checkout feature/login</code><br>
                                <code>git rebase main</code>
                            </div>
                            <p class="text-gray-700 text-sm">将feature/login分支的提交"重放"到main分支的最新提交之上</p>
                        </div>
                        <div class="p-4 bg-gray-50 rounded-lg">
                            <h4 class="font-semibold text-blue-800 mb-2">Rebase vs Merge</h4>
                            <table class="w-full text-sm">
                                <thead>
                                    <tr class="border-b">
                                        <th class="text-left py-2">操作</th>
                                        <th class="text-left py-2">优点</th>
                                        <th class="text-left py-2">缺点</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="border-b">
                                        <td class="py-2">Merge</td>
                                        <td class="py-2">保留完整历史，操作简单</td>
                                        <td class="py-2">产生额外合并提交，历史可能混乱</td>
                                    </tr>
                                    <tr>
                                        <td class="py-2">Rebase</td>
                                        <td class="py-2">线性历史更清晰，无合并噪音</td>
                                        <td class="py-2">重写历史，需谨慎使用</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Advanced Git -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 highlight">6. Git的高级使用技巧</h2>
            <p class="mb-6 text-gray-700">
                Git不仅仅是一个简单的版本控制工具，还提供了很多高级功能，能够帮助开发者更高效地管理代码和工作流。
            </p>

            <div class="grid md:grid-cols-3 gap-6">
                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 p-3 rounded-full mr-4">
                                <i class="fas fa-cubes text-indigo-700 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-bold">6.1 Git Submodule</h3>
                        </div>
                        <p class="text-gray-700 mb-4">
                            将其他Git仓库作为子模块包含在当前项目中，适合管理多仓库依赖关系。
                        </p>
                        <div class="code-block p-4 rounded-lg mb-2">
                            <code>git submodule add &lt;repository-url&gt;</code>
                        </div>
                        <p class="text-gray-700 text-sm">添加子模块到项目中</p>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-yellow-100 p-3 rounded-full mr-4">
                                <i class="fas fa-cherries text-yellow-700 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-bold">6.2 Git Cherry-pick</h3>
                        </div>
                        <p class="text-gray-700 mb-4">
                            选择特定提交应用到当前分支，而不是合并整个分支。
                        </p>
                        <div class="code-block p-4 rounded-lg mb-2">
                            <code>git cherry-pick &lt;commit-hash&gt;</code>
                        </div>
                        <p class="text-gray-700 text-sm">将指定提交应用到当前分支</p>
                    </div>
                </div>

                <div class="card-hover bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-green-100 p-3 rounded-full mr-4">
                                <i class="fas fa-box-open text-green-700 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-bold">6.3 Git Stash</h3>
                        </div>
                        <p class="text-gray-700 mb-4">
                            临时保存当前工作目录的修改，以便切换分支处理其他任务。
                        </p>
                        <div class="code-block p-4 rounded-lg mb-2">
                            <code>git stash</code><br>
                            <code>git stash pop</code>
                        </div>
                        <p class="text-gray-700 text-sm">保存和恢复工作进度</p>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="flex flex-col items-center text-center">
                <h3 class="text-xl font-bold mb-2">技术小馆</h3>
                <p class="text-gray-400 mb-4">分享技术知识与最佳实践</p>
                <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition duration-300 underline">
                    http://www.yuque.com/jtostring
                </a>
                <div class="mt-6 flex space-x-4">
                    <a href="#" class="text-gray-400 hover:text-white transition duration-300">
                        <i class="fab fa-github text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-white transition duration-300">
                        <i class="fab fa-twitter text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-white transition duration-300">
                        <i class="fab fa-weixin text-xl"></i>
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            gitGraph: {
                mainBranchName: 'main'
            }
        });
    </script>
</body>
</html>
```